from processing.model.component import Component
from _collections import deque
from pyprocessing import fill, stroke

class StaticShape(Component):
          
    def __init__(self, parent, drawer, sizes, colors):
        Component.__init__(self)
        self.parent = parent
        self.__drawer = drawer
        self.__colors = deque()
        for color in colors:
            self.colors.append(color)
        self.__sizes = sizes
        self.__center = max(sizes) / 2

    def update(self):
        pass
        
    def draw(self):
        colors_len = len(self.sizes)
        stroke(*self.colors[colors_len-1])
        for index in range (0, colors_len):
            fill(*self.colors[index])
            self.drawer.draw(self, self.sizes[index], self.center)
            
    @property
    def drawer(self):
        return self.__drawer
    
    @drawer.setter
    def drawer(self, value):
        self.__drawer = value
           
    @property
    def colors(self):
        return self.__colors
               
    @property
    def center(self):
        return self.__center
    
    @colors.setter
    def colors(self, value):
        self.__colors = value
    
    @property
    def sizes(self):
        return self.__sizes

    @sizes.setter
    def sizes(self, value):
        self.__sizes = value